package bancosys.tec.services.test.services;

import jmine.tec.di.annotation.Injected;
import jmine.tec.services.ServicesController;
import jmine.tec.services.annotations.Execution;
import jmine.tec.services.annotations.Input;
import jmine.tec.services.annotations.Output;
import jmine.tec.services.annotations.ServiceImplementor;
import jmine.tec.services.api.ActionsEnum;
import junit.framework.Assert;

@ServiceImplementor(action = ActionsEnum.INCLUIR, stateless = true)
public class StatelessService {

    private ServicesController controller;

    public StatelessService(@Injected ServicesController controller) {
        this.controller = controller;
    }

    @Injected
    public void setSomething(ServicesController controller) {
        Assert.assertNotNull(controller);
    }

    @Execution
    @Output(propertyName = "saida")
    public boolean execute(@Input(fieldName = MockService.CAMPO_OBRIGATORIO_1) String par) {
        Assert.assertNotNull(this.controller);
        return true;
    }

}
